<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    @using (Html.BeginForm("Index", "Students", FormMethod.Post))
    {
        <input type="text" name="keyword" placeholder="请输入关键字">
        <input type="submit" value="搜索">
        <a asp-action="Create">新增</a>
    }
    <table>
        <thead>
            <tr>
                <th>Id</th>
                <th>学号</th>
                <th>姓名</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@item.Id</td>
                    <td>@item.StudentId</td>
                    <td>@item.StudentName</td>
                    <td>
                        <a asp-action="Edit" asp-route-id="@item.Id">修改</a>
                        <a asp-action="Delete" asp-route-id="@item.Id">删除</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
</body>

</html>